<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\relation\HasMany;

/**
 * @mixin \think\Model
 */
class Role extends Model
{
    protected $table = 'enterprise_role';
    public function getPermissionsAttr($value)
    {
        return json_decode($value,true);
    }

    public function enterprises(): HasMany
    {
        return $this->hasMany(Enterprise::class,'role_id','id');
    }
}
